package baseTest;

public class climbStairs {
    public static void main(String[] args) {
        System.out.println(process(1));
    }
    //我愿称之为三行情书
//    public static int process(int n){
//        if ( n == 0 || n == 1){
//            return 1;
//        }
//        return  process(n-1) + process(n-2);
//    }
    //动态规划
    public static int process(int n){
        int[] arr = new int[n];
        arr[0] = 1;
        if (n>1)
        arr[1] = 2;
        for (int i = 2; i < n; i++) {
            arr[i] = arr[i-1] + arr[i-2];
        }
        return arr[n-1];
    }

}
